// createStore 可执行方法，用来生成一个store实例对象
import { createStore, createLogger } from 'vuex'
import user from './module/user'
import cart from './module/cart'
import category from './module/category'
// 引入自动同步插件
import createPersistedstate from 'vuex-persistedstate'
export default createStore({
  state: {
  },
  mutations: {
  },
  actions: {
  },
  modules: {
    user, cart, category
  },
  plugins: [
    createPersistedstate({
      key: 'erabbit-client-pc-store', // 存入本地localstorage
      paths: ['user', 'cart'] // 哪个模块想要自动同步功能
    }),
    createLogger()
  ]
})
